Skip to content

Conversation

@maximo-calero
Copy link

I added several changes to establish the order to load the house before the character:

  • New method GetHousesAndCharacters to create config objects. In the housesRequestConfig config object the callback has another callback to invoke the character method (GetCharacters).
  • New method GetHouses to load the house.
  • New method GetCharacters to load the character.
  • I modified the handleHousesRequestSucces callback method to invoke GetCharacters.
    I think with these changes we insure that the house loads before character.

function handleHousesRequestSucces(apiMapper, printer) {
function handleHousesRequestSucces(apiMapper, printer, callback, charactersRequestConfig) {
return function () {
const data = JSON.parse(this.responseText);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arrow function?

};
service.getCharactersByName(characterInput.value, charactersRequestConfig);
console.log('3');
GetHousesAndCharacters(houseInput, characterInput);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice I see the point sync bot together. That's a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants